import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    port: 5200,
    hmr: {
      overlay: true,
    },
    proxy: {
      '/preview/': {
        target: 'http://localhost:3000/',
        ws: true,
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/preview\//, '/'), // 如果需要重写请求路径
      },
    }
  },
})
